<h1>NAME</h1>
<p>nbfc_service.json - Notebook FanControl service configuration</p>
<h1>CONFIGURATION</h1>
<p><strong>NOTE</strong>: Comments can be added in any JSON object by
using the <strong>Comment</strong> field.</p>
<h2>ServiceConfig</h2>
<p>Main configuration file of nbfc_service (<em>/etc/nbfc.json</em>)</p>
<p><strong>SelectedConfigId</strong>: <em>String</em></p>
<blockquote>
<p>The selected config model. This equals the basename of a notebook
model configuration file. Absolute file paths can also be specified.</p>
</blockquote>
<p><strong>EmbeddedControllerType</strong>: <em>String</em></p>
<blockquote>
<blockquote>
<ul>
<li><p><strong>ec_sys</strong>: Use the ec_sys kernel module for writing
to the embedded controller.</p></li>
<li><p><strong>acpi_ec</strong>: Use the acpi_ec kernel module for
writing to the embedded controller.</p></li>
<li><p><strong>dev_port</strong>: Write to the embedded controller using
/dev/port.</p></li>
<li><p><strong>dummy</strong>: Don't write to the embedded controller at
all.</p></li>
</ul>
</blockquote>
<p>If not given, the embedded controller type will be automatically
selected.</p>
</blockquote>
<p><strong>TargetFanSpeeds</strong>: <em>Array of Floats</em></p>
<blockquote>
<p>This holds the fixed speed of the fans. A value of
<strong>-1</strong> means the fan should be left in auto mode.</p>
</blockquote>
<h2>ModelConfig</h2>
<p><strong>NotebookModel</strong>: <em>String</em></p>
<blockquote>
<p>The Notebook Model as described in your BIOS. See <strong>nbfc
get-model-name.</strong></p>
</blockquote>
<p><strong>Author</strong>: <em>String</em></p>
<blockquote>
<p>The Author of the config file. Enter whatever you want.</p>
</blockquote>
<p><strong>LegacyTemperatureThresholdsBehaviour</strong>:
<em>Boolean</em></p>
<blockquote>
<p>This option was introduced for beeing backwards compatible with
configuration files from the original NBFC project. The default is
<strong>false</strong>. Do not use this option for new configuration
files.</p>
</blockquote>
<p><strong>EcPollInterval</strong>: <em>Integer</em> &gt; 0</p>
<blockquote>
<p>Defines how often NBFC polls the EC for changes (in
milliseconds).</p>
</blockquote>
<p><strong>CriticalTemperature</strong>: <em>Integer</em></p>
<blockquote>
<p>If the temperature exceeds this threshold, NBFC will ignore all
Temperature threshold elements and set the fan to 100% speed until the
temperature drops below
(<strong>CriticalTemperature</strong>-<strong>CriticalTemperatureOffset</strong>).</p>
</blockquote>
<p><strong>CriticalTemperatureOffset</strong>: <em>Integer</em> &gt;
0</p>
<blockquote>
<p>See <strong>CriticalTemperature</strong></p>
</blockquote>
<p><strong>ReadWriteWords</strong>: <em>Boolean</em></p>
<blockquote>
<p>If <strong>true</strong>, NBFC will combine two 8 bit registers to
one 16-bit register when reading from or writing to the EC
registers.</p>
</blockquote>
<p><strong>FanConfigurations</strong>: <em>Array of
FanConfigurations</em></p>
<blockquote>
<p>Array of at least one FanConfiguration</p>
</blockquote>
<p><strong>RegisterWriteConfigurations</strong>: <em>Array of
RegisterWriteConfiguration</em></p>
<blockquote>
<p>Array of RegisterWriteConfiguration</p>
</blockquote>
<h2>FanConfiguration</h2>
<p>Defines how NBFC controls a fan</p>
<p><strong>FanDisplayName</strong>: <em>String</em></p>
<blockquote>
<p>Fan display name</p>
</blockquote>
<p><strong>ReadRegister</strong>: <em>Integer</em> &gt;= 0 &amp;&amp;
<em>Integer</em> &lt;= 255</p>
<blockquote>
<p>The register from which NBFC reads the fan speed.</p>
</blockquote>
<p><strong>WriteRegister</strong>: <em>Integer</em> &gt;= 0 &amp;&amp;
<em>Integer</em> &lt;= 255</p>
<blockquote>
<p>The register which NBFC uses to control the fan.</p>
</blockquote>
<p><strong>ReadAcpiCommand</strong>: <em>String</em></p>
<blockquote>
<p>The ACPI method for reading the fan speed.</p>
<p>Example:</p>
<blockquote>
<p>"ReadAcpiCommand": "\\_SB.PCI0.LPCB.EC0.GFSD"</p>
</blockquote>
<p>This option is mutually exclusive to <strong>ReadRegister</strong>.
Only one of them can be set at a time.</p>
</blockquote>
<p><strong>WriteAcpiCommand</strong>: <em>String</em></p>
<blockquote>
<p>The ACPI method for writing the fan speed. The command must contain a
placeholder ($) which will be replaced by the fan speed.</p>
<p>Example:</p>
<blockquote>
<p>"WriteAcpiCommand": "\\_SB.PCI0.LPCB.EC0.SFSD $"</p>
</blockquote>
<p>This option is mutually exclusive to <strong>WriteRegister</strong>.
Only one of them can be set at a time.</p>
</blockquote>
<p><strong>MinSpeedValue</strong>: <em>Integer</em></p>
<blockquote>
<p>The value which puts the fan to the lowest possible speed (usually
this stops the fan). Must be an integer between 0 and 255 or 0 and 65535
if <strong>ReadWriteWords</strong> is <strong>true</strong>. Note:
<strong>MinSpeedValue</strong> does not necessarily have to be smaller
than <strong>MaxSpeedValue.</strong></p>
</blockquote>
<p><strong>MaxSpeedValue</strong>: <em>Integer</em></p>
<blockquote>
<p>The value which puts the fan to the highest possible fan speed.</p>
</blockquote>
<p><strong>MinSpeedValueRead</strong>: <em>Integer</em></p>
<blockquote>
<p>The value which corresponds to the lowest possible fan speed. Will be
ignored if <strong>IndependentReadMinMaxValues</strong> is
<strong>false</strong>.</p>
</blockquote>
<p><strong>MaxSpeedValueRead</strong>: <em>Integer</em></p>
<blockquote>
<p>The value which corresponds to the highest possible fan speed. Will
be ignored if <strong>IndependentReadMinMaxValues</strong> is
<strong>false</strong>.</p>
</blockquote>
<p><strong>IndependentReadMinMaxValues</strong>: <em>Boolean</em></p>
<blockquote>
<p>Defines if independent minimum/maximum values should be applied for
read operations.</p>
</blockquote>
<p><strong>ResetRequired</strong>: <em>Boolean</em></p>
<blockquote>
<p>Defines if the EC should be reset before the service is shut
down.</p>
</blockquote>
<p><strong>FanSpeedResetValue</strong>: <em>Integer</em></p>
<blockquote>
<p>Defines the value which will be written to
<strong>WriteRegister</strong> to reset the EC.</p>
</blockquote>
<p><strong>ResetAcpiCommand</strong>: <em>String</em></p>
<blockquote>
<p>The ACPI method to call upon fan reset.</p>
<p>This option is mutually exclusive to
<strong>FanSpeedResetValue</strong>. Only one of them can be set at a
time.</p>
</blockquote>
<p><strong>Sensors</strong>: <em>Array of String</em></p>
<blockquote>
<p>Defines which sensors shall be used for this fan. This should either
be a sensor name or a sensor group.</p>
<p>Available groups:</p>
<ul>
<li><p><strong>@CPU</strong>: Uses all sensors named
<strong>coretemp</strong>, <strong>k10temp</strong> or
<strong>zenpower</strong></p></li>
<li><p><strong>@GPU</strong>: Uses all sensors named
<strong>amdgpu</strong>, <strong>nvidia</strong>,
<strong>nvidia-ml</strong>, <strong>nouveau</strong> or
<strong>radeon</strong></p></li>
</ul>
</blockquote>
<p><strong>TemperatureAlgorithmType</strong>: <em>String</em></p>
<blockquote>
<p>Specify the algorithm type to compute the temperature.</p>
<ul>
<li><p><strong>Average</strong>: Computes the average temperature from
all specified sensors (default)</p></li>
<li><p><strong>Min</strong>: Selects the lowest temperature among all
specified sensors</p></li>
<li><p><strong>Max</strong>: Selects the highest temperature among all
specified sensors</p></li>
</ul>
</blockquote>
<p><strong>TemperatureThresholds</strong>: <em>Array of
TemperatureThresholds</em></p>
<p><strong>FanSpeedPercentageOverrides</strong>: <em>Array of
FanSpeedPercentageOverride</em></p>
<h2>RegisterWriteConfiguration</h2>
<p>Allows to write to any EC register</p>
<p><strong>WriteMode</strong>: <em>String</em></p>
<blockquote>
<p>Defines how the value will be written:</p>
<ul>
<li><p><strong>Set</strong>: overwrites the register with the specified
value (register = value)</p></li>
<li><p><strong>And</strong>: performs a binary AND operation (register =
register &amp; value)</p></li>
<li><p><strong>Or</strong>: performs a binary OR operation (register =
register | value)</p></li>
<li><p><strong>Call</strong>: calls the ACPI method stored in
<strong>AcpiCommand</strong> or
<strong>ResetAcpiCommand</strong></p></li>
</ul>
</blockquote>
<p><strong>WriteOccasion</strong>: <em>String</em></p>
<blockquote>
<p>Defines when the value should be written:</p>
<ul>
<li><p><strong>OnInitialization</strong>: writes the value once upon
initialization (everytimee the fan control service is enabled or a
config is applied)</p></li>
<li><p><strong>OnWriteFanSpeed</strong>: writes the value everytimee the
fan speed is set.</p></li>
</ul>
</blockquote>
<p><strong>Register</strong>: <em>Integer</em> &gt;= 0 &amp;&amp;
<em>Integer</em> &lt;= 255</p>
<blockquote>
<p>The register which will be manipulated.</p>
</blockquote>
<p><strong>Value</strong>: <em>Integer</em></p>
<blockquote>
<p>The value which will be written.</p>
</blockquote>
<p><strong>AcpiCommand</strong>: <em>String</em></p>
<blockquote>
<p>The ACPI method to call.</p>
<p>This option is mutually exclusive to <strong>Value</strong>. Only one
of them can be set at a time.</p>
</blockquote>
<p><strong>ResetRequired</strong>: <em>Boolean</em></p>
<blockquote>
<p>Defines if the register should be reset before the service is shut
down.</p>
</blockquote>
<p><strong>ResetValue</strong>: <em>Integer</em></p>
<blockquote>
<p>The value which will be written upon reset.</p>
</blockquote>
<p><strong>ResetAcpiCommand</strong>: <em>String</em></p>
<blockquote>
<p>The ACPI method to call upon reset.</p>
<p>This option is mutually exclusive to <strong>ResetValue</strong>.
Only one of them can be set at a time.</p>
</blockquote>
<p><strong>ResetWriteMode</strong>: <em>String</em></p>
<blockquote>
<p>See <strong>WriteMode</strong>. Will only be applied on reset.</p>
</blockquote>
<p><strong>Description</strong>: <em>String</em></p>
<blockquote>
<p>A short description of what effect the
<strong>RegisterWriteConfiguration</strong> will have.</p>
</blockquote>
<h2>FanSpeedPercentageOverride</h2>
<p>Overrides the default algorithm to calculate fan speeds.</p>
<p><strong>FanSpeedPercentage</strong>: <em>Float</em> &gt;= 0.0
&amp;&amp; <em>Float</em> &lt;= 100.0</p>
<blockquote>
<p>The fan speed in percent.</p>
</blockquote>
<p><strong>FanSpeedValue</strong>: <em>Integer</em></p>
<blockquote>
<p>The fan speed value which will be written to
<strong>WriteRegister</strong>.</p>
</blockquote>
<p><strong>TargetOperation</strong>: <em>String</em></p>
<blockquote>
<p>Defines for which operations the speeds should be overridden:</p>
<blockquote>
<ul>
<li><p><strong>Read</strong>: if the value in the EC's ReadRegister is
equal to <strong>FanSpeedValue</strong>, the corresponding percentage
will not be calculated, but instead be set to
<strong>FanSpeedPercentage</strong>.</p></li>
<li><p><strong>Write</strong>: if the target fan speed percentage is
equal to <strong>FanSpeedPercentage</strong>, the corresponding value
will not be calculated, but instead be set to
<strong>FanSpeedValue</strong>.</p></li>
<li><p><strong>ReadWrite</strong>: applies to both, read and write
operations.</p></li>
</ul>
</blockquote>
</blockquote>
<h2>TemperatureThreshold</h2>
<p>Defines how fast the fan runs at different temperatures.</p>
<p><strong>UpThreshold</strong>: <em>Integer</em></p>
<blockquote>
<p>NBFC will select the next upper threshold as soon as the temperature
exceeds <em>UpThreshold</em>(in celsius).</p>
</blockquote>
<p><strong>DownThreshold</strong>: <em>Integer</em></p>
<blockquote>
<p>NBFC will select the next lower threshold as soon as the temperature
falls below the <em>DownThreshold</em>(in celsius).</p>
</blockquote>
<p><strong>FanSpeed</strong>: <em>Float</em> &gt;= 0.0 &amp;&amp;
<em>Float</em> &lt;= 100.0</p>
<blockquote>
<p>The fan speed in percent.</p>
</blockquote>
<h1>FILES</h1>
<p><em>/etc/nbfc.json</em></p>
<blockquote>
<p>The main configuration file for nbfc_service.</p>
</blockquote>
<p><em>/var/run/nbfc_service.pid</em></p>
<blockquote>
<p>File containing the PID of current running nbfc_service.</p>
</blockquote>
<p><em>/var/run/nbfc_service.socket</em></p>
<blockquote>
<p>Socket file of nbfc_service.</p>
</blockquote>
<p><em>/usr/share/nbfc/configs/*.json</em></p>
<blockquote>
<p>Configuration files for various notebook models.</p>
</blockquote>
<p><em>/usr/share/nbfc/model_support.json</em></p>
<blockquote>
<p>Model support database. This file maps notebook model names to
configuration files.</p>
</blockquote>
<p><em>/var/lib/nbfc/configs/*.json</em></p>
<blockquote>
<p>Configuration files downloaded from the internet. Files in this
directory take precedence over those in
<em>/usr/share/nbfc/configs</em>.</p>
</blockquote>
<p><em>/var/lib/nbfc/model_support.json</em></p>
<blockquote>
<p>Model support database downloaded from the internet. Both
<em>/var/lib/nbfc/model_support.json</em> and
<em>/usr/share/nbfc/model_support.json</em> are taken into account.</p>
</blockquote>
<p><em>/var/lib/nbfc/state.json</em></p>
<blockquote>
<p>State file of nbfc_service. This holds the current fan speeds.</p>
</blockquote>
<h1>AUTHOR</h1>
<p>Benjamin Abendroth (braph93@gmx.de)</p>
<h1>SEE ALSO</h1>
<p><strong>nbfc</strong>(1), <strong>nbfc_service</strong>(1),
<strong>ec_probe</strong>(1), <strong>fancontrol</strong>(1),
<strong>sensors</strong>(1)</p>
